Next | Prev | Up | Top | Contents | Index

Creating DSOs

To create a DSO from a set of object files, use ld with the -shared option:

ld -shared stuff.o nonsense.o -o libdada.so

The above example creates a DSO, libdada.so, from two object files, stuff.o and nonsense.o. Note that DSO names should begin with "lib" and end with ".so", for ease of use with the compiler driver's -llib argument. If you're already building an archive library (.a file), you can create a DSO from the library by using the -shared and -all arguments to ld:

ld -shared -all libdada.a -o libdada.so

The -all argument specifies that all of the object files from the library, libdada.a, should be included in the DSO.


Next | Prev | Up | Top | Contents | Index